package com.maimao.model.info;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;
import org.springframework.data.annotation.Id;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author MaoLin Wang
 * @date 2020/11/28 12:10 上午
 */
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("mm_collect")
public class Collect implements Serializable {

    private static final long serialVersionUID = -7910066186789407274L;

    @TableId(type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @TableField("user_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    /**
     * type=0: 店铺id type=1: 商品id
     */
    @TableField("target_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long targetId;

    /**
     * 1商品0店铺
     */
    @TableField("type")
    private Integer type;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("deleted")
    private Integer deleted;

    @Override
    public String toString() {
        return "Collect{" +
                "id=" + id +
                ", userId=" + userId +
                ", targetId=" + targetId +
                ", type=" + type +
                ", createTime=" + createTime +
                ", deleted=" + deleted +
                '}';
    }
}
